clear;
WE=4;SN=2;lamda=1852;
WE=WE*lamda;
SN=SN*lamda;
theta=2*pi/3;
mcnt=ones(11,171);
i=0;j=0;
for cover=0.1:0.01:0.2
    i=i+1;j=0;
    for angle=0:0.01:1.7
        j=j+1;
        alpha=angle*pi/180;
        D0=110-WE/2*tan(alpha);
        pos=[];
        angle1=pi/2+alpha-theta/2;
        angle2=pi/2-alpha-theta/2;
        xlast=D0/(sin(angle1)/cos(alpha)-sin(theta/2)*tan(alpha));
        pos=[xlast];
        while 1
            xnew=(xlast*(1/cos(alpha)+sin(theta/2)*tan(alpha)/sin(angle2))+D0*(1-cover)*sin(theta/2)*(1/sin(angle2)+1/sin(angle1)))/(cover*tan(alpha)*sin(theta/2)*(1/sin(angle2)+1/sin(angle1))-tan(alpha)*sin(theta/2)/sin(angle1)+1/cos(alpha));
            if xnew>WE
                break;
            end
            pos=[pos,xnew];
            xlast=xnew;
        end
        mcnt(i,j)=length(pos);
    end
end
[X,Y]=meshgrid([0.1:0.01:0.2],[0:0.01:1.7]);
mesh(X',Y',mcnt);
ylabel('$\alpha$','Interpreter',"latex")
xlabel('$\eta$','Interpreter',"latex")
zlabel('测线条数')